from flask import Flask
from config import Config
from auth import auth_bp
from main import main_bp

def create_app():
    """应用工厂函数,用于创建和配置Flask应用"""
    app = Flask(__name__)
    app.config.from_object(Config)  # 加载配置
    
    # 注册蓝图
    app.register_blueprint(auth_bp)
    app.register_blueprint(main_bp)
    
    return app

if __name__ == '__main__':
    app = create_app()
    app.run(host='0.0.0.0', port=8080,debug=True)  # 允许所有网络接口访问